home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / PlainTalk Developer / Text-to-Speech / Installer Source / Templates / InstallAResource.r < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-03  |  3.3 KB  |  99 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    File:        InstallAResource.r -    Rez Source
  4.  *
  5.  *    Author:        Deric Horn
  6.  *
  7.  *    Template for installing resources.
  8.  *    This contains the necessary type deffinitions to install resources.
  9.  *
  10.  *    History:    <1>    (12/2/94) Created this file.
  11.  *
  12.  *----------------------------------------------------------------------------*/
  13.  
  14. #ifndef    RESOURCESIZE
  15.     #define RESOURCESIZE 0
  16. #endif
  17.  
  18. #ifndef    RESOURCENAME
  19.     #define RESOURCENAME ""
  20. #endif
  21.  
  22. #ifndef    SOURCEinfsID
  23.     #define SOURCEinfsID sourceFileBase+ID
  24.     resource 'infs' (sourceFileBase+ID,RESOURCENAME) {
  25.         FILETYPE,                            /* File Type */
  26.         FILECREATOR,                        /* Creator */
  27.         kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  28.         noSearchForFile,                    /* Do not search the source disk for the file */
  29.         TypeCrMustMatch,                    /* file type and creator on source disk must match */
  30.         SOURCEDIR FILENAME                    /* Path to the file */
  31.     };
  32. #endif
  33.  
  34. #ifndef    TARGETinfsID
  35.     #define TARGETinfsID sourceFileBase+ID
  36.     resource 'infs' (targetFileBase+ID,RESOURCENAME) {
  37.         0,                                    /* File Type */
  38.         0,                                    /* Creator */
  39.         0,                                    /* creation date not needed for target file specs */
  40.         noSearchForFile,                    /* Do not search the target disk for the file */
  41.         TypeCrNeedNotMatch,                    /* not needed for target file specs */
  42.         DESTDIR DESTFILENAME                /* destination Path */
  43.     };
  44. #endif
  45.  
  46. #ifndef SOURCEResourceID
  47.     #define    SOURCEResourceID    RESOURCEID
  48.     #define    TARGETResourceID    RESOURCEID
  49. #endif
  50.  
  51. #ifndef    DELETERESOURCE
  52.     #define    DELETERESOURCE    deleteWhenRemoving
  53. #endif
  54.  
  55. #ifndef PRESERVEEXISTING
  56.     #define PRESERVEEXISTING    updateExisting    // Default to clobbering an existing resource.
  57. #endif
  58.  
  59. resource 'inra' (sourceFileBase+ID,RESOURCENAME) {
  60.     format1 {
  61.         DELETERESOURCE,                    /* Remove file or rsrc if remove clicked */
  62.         dontDeleteWhenInstalling,         // We're adding not removing.
  63.         copy,                             /* Copy the file to the destination */
  64.         updateEvenIfNewer,                //  Do not update a newer file
  65.         noTgtRequired,                     // tgtRequired gives alert even if installing target.  Bad.
  66.         PRESERVEEXISTING,                 /* Keep tgt rsrc if it already exists */
  67.         copyIfNewOrUpdate,                 /* Only update if target exists    */
  68.         ignoreProtection,                 /* Do it even if rsrc protected */
  69.         srcNeedNotExist,                 /* Rsrc need not exist on source */
  70.         byID,                             /* Use name or id to find rsrc    */
  71.         nameNeedNotMatch,                 /* name must match*/
  72.         RESOURCESIZE,                    // Resource size in bytes.  For disk space calculation.
  73.         TARGETinfsID,                    /* TARGET file spec for this file */
  74.         RESOURCETYPE,                    /* Resource Type */
  75.         TARGETResourceID,                /* Target ID */
  76.         0x0,                            // Target resource attributes.
  77.         RESOURCENAME,                    /* Resource Name */
  78.         {
  79.             SOURCEinfsID,                /* SOURCE file spec for this file */
  80.             RESOURCETYPE,                /* Resource Type */
  81.             SOURCEResourceID,            /* Target ID */
  82.             0,                            //    Resource size (filled in by ScriptCheck)
  83.             RESOURCENAME,                /* Resource Name */
  84.         },
  85.         0,                                // Source version number.  Unneeded since no version compare.
  86.         0,                                // MUST be the 'invc' id of the custom version proc.
  87.         0,                                // Atom extender resource ID.
  88.         "Installing Resource: "RESOURCENAME,    /* Atom Description */
  89.     };
  90. };
  91.  
  92. #undef RESOURCESIZE
  93. #undef RESOURCENAME
  94. #undef SOURCEinfsID
  95. #undef TARGETinfsID
  96. #undef SOURCEResourceID
  97. #undef DELETERESOURCE
  98. #undef PRESERVEEXISTING
  99.